package com.lipaluma.test.db.annotations.assertions;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import com.lipaluma.test.db.internal.assertions.ColumnType;

/**
 * Execute a request directly in database and test expected values.<br/>
 * the order of expected values has to correspond of the order of the columns defined in the request.
 * @author Mario
 */
@Documented
@Inherited
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface AssertColumns {

	/**
	 * expected values
	 * @return
	 */
	String[] expected();
	
	/**
	 * request to execute
	 * @return
	 */
	String request();
	
	/**
	 * type of columns.
	 * @return
	 */
	ColumnType[] type() default ColumnType.STRING;
	
	/**
	 * null value to use in expected field
	 * @return
	 */
	String nullValue() default "NULL";
	
	String dataSource() default "";
	
	/**
	 * Define several {@link AssertColumns} to do several requests to test 
	 * @author Mario
	 */
	@Documented
	@Inherited
	@Target({ElementType.METHOD})
	@Retention(RetentionPolicy.RUNTIME)
	public @interface List {
		AssertColumns[] value();
	}
}
